package com.example.api.controller.app;

import com.example.api.query.AddressQuery;
import com.example.api.service.CategoryService;
import com.example.api.utils.PageResult;
import com.example.api.utils.Result;
import com.example.api.vo.AddressVO;
import com.example.api.vo.CategoryDetailVO;
import com.example.api.vo.CategoryVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "店铺接口")
@RestController
@RequestMapping("/app/shop")
public class ShopController {


    @Resource
    CategoryService categoryService;


    @ApiOperation("查询店铺菜品")
    @GetMapping("/{shopId}/food")
    public Result<List<CategoryDetailVO>> find(@PathVariable int shopId){

        List<CategoryDetailVO> result = categoryService.findCategoryAndFood(shopId);
        return Result.ok("成功",result);
    }

}
